<?php namespace Common\Model;
use Hdphp\Model\Model;
//注册管理模型
class Register extends Model{
	//指定表名
	protected $table="user_login";
	//自动验证
	protected $validate=array(
		array('useremail','email','邮箱格式不正确',3,3),
		array('userpassword','required','请填写密码',3,3),
		array('password2','required','请填写密码',3,3),
		array('code','required','请填写验证码',3,3)
	
	);
	//自定义store方法
	public function store(){
		//调用框架create方法，触发自动验证
		if($this->create()){
			$data=Q('post.userpassword','','md5');
			$this->data['userpassword']=$data;
			return $this->add();
		}else{
			return false;
		}
	}
	
}



 ?>